/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "fiscal_indice")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FiscalIndice.findAll", query = "SELECT f FROM FiscalIndice f")})
public class FiscalIndice implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    private Character periodicidade;
    @Column(name = "DIARIO_A_PARTIR_DE")
    @Temporal(TemporalType.DATE)
    private Date diarioAPartirDe;
    @Column(name = "MENSAL_MES_ANO", length = 7)
    private String mensalMesAno;
    @JoinColumn(name = "ID_EMPRESA", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private Empresa idEmpresa;
    @JoinColumn(name = "ID_INDICE_ECONOMICO", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private IndiceEconomico idIndiceEconomico;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idFiscalIndice")
    private List<FiscalIndiceValor> fiscalIndiceValorList;

    public FiscalIndice() {
    }

    public FiscalIndice(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Character getPeriodicidade() {
        return periodicidade;
    }

    public void setPeriodicidade(Character periodicidade) {
        this.periodicidade = periodicidade;
    }

    public Date getDiarioAPartirDe() {
        return diarioAPartirDe;
    }

    public void setDiarioAPartirDe(Date diarioAPartirDe) {
        this.diarioAPartirDe = diarioAPartirDe;
    }

    public String getMensalMesAno() {
        return mensalMesAno;
    }

    public void setMensalMesAno(String mensalMesAno) {
        this.mensalMesAno = mensalMesAno;
    }

    public Empresa getIdEmpresa() {
        return idEmpresa;
    }

    public void setIdEmpresa(Empresa idEmpresa) {
        this.idEmpresa = idEmpresa;
    }

    public IndiceEconomico getIdIndiceEconomico() {
        return idIndiceEconomico;
    }

    public void setIdIndiceEconomico(IndiceEconomico idIndiceEconomico) {
        this.idIndiceEconomico = idIndiceEconomico;
    }

    @XmlTransient
    public List<FiscalIndiceValor> getFiscalIndiceValorList() {
        return fiscalIndiceValorList;
    }

    public void setFiscalIndiceValorList(List<FiscalIndiceValor> fiscalIndiceValorList) {
        this.fiscalIndiceValorList = fiscalIndiceValorList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FiscalIndice)) {
            return false;
        }
        FiscalIndice other = (FiscalIndice) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.FiscalIndice[ id=" + id + " ]";
    }
    
}
